#include <stdio.h>

int main(void)
{
    FILE * fp;

    fp = fopen("text.txt", "a+");

    fputs("abcdefg\n", fp);
    fputs("dddddddd\n", fp);
    fputs("uuuuuuuu\n", fp);

    rewind(fp);

    char str[129];

    fscanf(fp, "%s", str);

    puts(str);

    fputs("\neee\n", fp);

    fclose(fp);
}
